﻿@model Adams.Public.DataTransfer.Web.DailPrayers.Index.PageLoad
@{
    Layout = "~/Views/Shared/_ContentLayout.cshtml";
}
@section Head{
}
<h1>Daily Prayer Times</h1>
<center>
    @foreach (var l in Model.Locations)
    {
        <a href="/Prayers/Daily/@Adams.Shared.UrlHelper.Enc(l.Name)/@(Adams.Shared.CalendarHelper.IsMonthHijri(ViewBag.Month) ? Adams.Shared.UrlHelper.Enc(Adams.Shared.CalendarHelper.GetHijriMonthName(Model.Month)) : Adams.Shared.UrlHelper.Enc(Adams.Shared.CalendarHelper.GetMonthName(Model.Month)))" @Html.Raw(l.ID == Model.LocationID ? "style='font-weight:bold;'" : "")>@l.Name</a> 
    }
    <br />
    @if (Adams.Shared.CalendarHelper.IsMonthHijri(ViewBag.Month))
    {
        for (var i = 1; i <= 12; i++)
        {
        <a href="/Prayers/Daily/@Adams.Shared.UrlHelper.Enc(Model.LocationName)/@Adams.Shared.UrlHelper.Enc(Adams.Shared.CalendarHelper.GetHijriMonthName(i))" @Html.Raw(i == Model.Month ? "style='font-weight:bold;'" : "")>@Adams.Shared.CalendarHelper.GetShortHijriMonthName(i)</a> 
        }
    }
    else
    {
        for (var i = 1; i <= 12; i++)
        {
            <a href="/Prayers/Daily/@Adams.Shared.UrlHelper.Enc(Model.LocationName)/@Adams.Shared.UrlHelper.Enc(Adams.Shared.CalendarHelper.GetMonthName(i))" @Html.Raw(i == Model.Month ? "style='font-weight:bold;'" : "")>@Adams.Shared.CalendarHelper.GetShortMonthName(i)</a> 
        }
    }
    <br />
    <a href="/Prayers/Daily/@Adams.Shared.UrlHelper.Enc(Model.LocationName)/@Adams.Shared.UrlHelper.Enc(Adams.Shared.CalendarHelper.GetMonthName(Model.Month))" @Html.Raw(!Adams.Shared.CalendarHelper.IsMonthHijri(ViewBag.Month) ? "style='font-weight:bold;'" : "")>Gregorian</a>
    <a href="/Prayers/Daily/@Adams.Shared.UrlHelper.Enc(Model.LocationName)/@Adams.Shared.UrlHelper.Enc(Adams.Shared.CalendarHelper.GetHijriMonthName(Model.Month))" @Html.Raw(Adams.Shared.CalendarHelper.IsMonthHijri(ViewBag.Month) ? "style='font-weight:bold;'" : "")>Hijri</a>
</center>
<table class="data" cellspacing="0">
    <tr>
        <th align="center">
            
        </th>
        <th align="center">
            
        </th>
        <th align="right">
            Fajr
        </th>
        <th align="right">
            Iqama
        </th>
        <th align="right">
            Sunrise
        </th>
        <th align="right">
            Duhr
        </th>
        <th align="right">
            Iqama
        </th>
        <th align="right">
            Asr
        </th>
        <th align="right">
            Iqama
        </th>
        <th align="right">
            Maghrib
        </th>
        <th align="right">
            Iqama
        </th>
        <th align="right">
            Isha
        </th>
        <th align="right">
            Iqama
        </th>
    </tr>
    @foreach (var prayer in Model.PrayerTimes)
    {
        <tr @Html.Raw(DateTime.Now.Month == prayer.Month && DateTime.Now.Day == prayer.Day ? "style='font-weight:bold;'" : "")>
            <td align="left">
                @Adams.Shared.CalendarHelper.GetShortMonthName(prayer.Month)&nbsp;@prayer.Day
            </td>
            <td align="left">
                @Adams.Shared.CalendarHelper.GetShortHijriMonthName(prayer.IMonth)&nbsp;@prayer.IDay
            </td>
            <td align="right">
                @prayer.Fajr
            </td>
            <td align="right">
                @prayer.FajrIqama
            </td>
            <td align="right">
                @prayer.Sunrise
            </td>
            <td align="right">
                @prayer.Duhr
            </td>
            <td align="right">
                @prayer.DuhrIqama
            </td>
            <td align="right">
                @prayer.Asr
            </td>
            <td align="right">
                @prayer.AsrIqama
            </td>
            <td align="right">
                @prayer.Maghrib
            </td>
            <td align="right">
                @prayer.MaghribIqama
            </td>
            <td align="right">
                @prayer.Isha
            </td>
            <td align="right">
                @prayer.IshaIqama
            </td>
        </tr>
    }
</table>
@section Scripts {
}
